<?php
use frontend\assets\AppAsset;
use yii\helpers\Url;

AppAsset::register($this);
$this->title = empty($parent_list['category_name']) ? '' : $parent_list['category_name'];
$cate_id = empty($parent_list['id']) ? 0 : $parent_list['id'];
$this->params['breadcrumbs'][] = $this->title;
$image_bath_url = Yii::$app->params['imageBathUrl'];
?>
<?php
AppAsset::addCss($this,$image_bath_url."/static/pc/css/common/font-awesome-4.7.0/css/font-awesome.min.css");
AppAsset::addCss($this,$image_bath_url."/static/pc/css/util/flickity.css");
AppAsset::addCss($this,$image_bath_url."/static/pc/css/common/proudct-left.css");
AppAsset::addCss($this,$image_bath_url."/static/pc/css/menu.css");
?>
    <article>
    <div class="w br4 mt50"></div>
    <section class="content w mt40">
    <!-- 左边引导 -->
    <div class="content-left-box left-w fl">
        <h3 class="h3"><?=empty($parent_list['category_name']) ? '' : $parent_list['category_name']?></h3>
        <!-- 分类品类品牌 -->
        <?= \frontend\widget\CategoryMenuWidget::widget() ?>
    </div>
    <!-- 左边引导 End-->
    <!-- 右边 -->
    <div class="content-right-box right-w fr">
        <!-- banner -->
        <?php if(!empty($match_list)){?>
        <div class="menu_right_banner">
            <ul class="menu_banner_img_big">
                <?php foreach($match_list as $value){?>
                <li class="item">
                    <a href="javascript:;">
                        <img src="<?=$image_bath_url . '/' . $value['img_main']?>" alt="<?=$value['img_main_alt']?>">
                    </a>
                </li>
                <?php }?>
            </ul>
            <div class="menu_scroll_box pr">
                <div class="menu_scroll pr d_l fl">
                    <ul class="img_big_scroll" id="scroll-list">
                    <?php foreach($match_list as $key=>$value){?>
                        <li <?php if($key == 0){?>class="item img-active"<?php }else{?>class="item"<?php }?> data-buy-set="<?=$value['id']?>">
                            <img src="<?=$image_bath_url . '/' . $value['img_small']?>" alt="<?=$value['img_small_alt']?>"/>
                        </li>
                    <?php }?>
                    </ul>
                    <a href="javascript:;" class="mid prev"><span class="icon fa fa-angle-left"></span></a>
                    <a href="javascript:;" class="mid next"><span class="icon  fa fa-angle-right"></span></a>
                </div>
                <div class="wechat_herf fr pr">
                    <a href="<?php echo Url::to(['/goods/match-list','cate_id'=>$cate_id]);?>" class="match_goods_list">购买此搭配 > </a>
                        <span><img src="<?=$image_bath_url ?>/static/pc/image/menu/jkjj_wechat.png" alt="公众号">
                             <div class="shadebox  wechat_img">
                                 <h2>分享到微信</h2>
                                 <img src="<?=$image_bath_url ?>/static/pc/image/iconPng/Bitmap.png" alt="wechat"/>
                             </div>
                        </span>

                </div>

            </div>
        </div>
        <?php }?>
        <!-- banner End -->
        <!-- 其他关联商品 -->
        <div class="enter_info_banner mt">
            <div class="enter_item e_i_1">
                <div class="item_left fl pr">
                    <div class="bgbor">
                        <div class="item_left_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more">查看详情 > </a>
                        </div>
                    </div>
                </div>
                <div class="item_right fr pr">
                    <div class="bgbor">
                        <div class="item_right_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more">查看详情 > </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="enter_item e_i_2 pr">
                <div class="bgbor">
                    <div class="item_left_info item-info mid">
                        <p>户外沙发</p>
                        <a href="javascript:;" class="link-more">查看详情 > </a>
                    </div>
                </div>
            </div>
            <div class="enter_item e_i_3">
                <div class="item_left fl pr">
                    <div class="bgbor">
                        <div class="item_left_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more">查看详情 > </a>
                        </div>
                    </div>
                </div>
                <div class="item_right fr pr">
                    <div class="bgbor">
                        <div class="item_right_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more">查看详情 > </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="enter_item e_i_4 pr">
                <div class="bgbor">
                    <div class="item_left_info item-info mid">
                        <p>户外沙发</p>
                        <a href="javascript:;" class="link-more">查看详情 > </a>
                    </div>
                </div>
            </div>
            <div class="enter_item e_i_5">
                <div class="item_left fl pr">
                    <div class="bgbor">
                        <div class="item_left_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more ">查看详情 > </a>
                        </div>
                    </div>
                </div>
                <div class="item_right fr pr">
                    <div class="bgbor">
                        <div class="item_right_info item-info mid">
                            <p>户外沙发</p>
                            <a href="javascript:;" class="link-more">查看详情 > </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 其他关联商品End -->
    </div>
    <!-- 右边 End-->
    </section>
</article>
<!-- 返回顶部 -->
<?= \Yii::$app->view->renderFile('@app/views/common/back-top.php');?>
<script type="text/javascript">
<?php $this->beginBlock('js') ?>
$('.match_goods_list').click(function(event){
    event.preventDefault();
    var url = $(this).attr("href");
    var cate_id = "<?=$cate_id?>";
    var buy_set_id = $('#scroll-list').find('li.img-active').attr("data-buy-set");
    if( url.indexOf('?')>0 ){
        url += '&buy_set=' + buy_set_id;
    }else{
        url += '?cate_id=' + cate_id + '&buy_set=' + buy_set_id;
    }
    window.location.href = url;
})
<?php $this->endBlock() ?>
<?php $this->registerJs($this->blocks['js'], \yii\web\View::POS_END); ?>
</script>
<?php
AppAsset::addJs($this,$image_bath_url."/static/pc/js/util/flickity.pkgd.min.js");
AppAsset::addJs($this,$image_bath_url."/static/pc/js/meun.js");
?>